package com.hmdp.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author wyh
 * @Date 2025/3/19 22:18
 * @description: Redission配置
 */
@Configuration
public class RedissonConfig {
    @Bean
    public RedissonClient redissonClient() {
        // 创建配置对象
        Config config = new Config();
        // 配置单机模式地址
        config.useSingleServer().setAddress("redis://192.168.88.131:6379").setPassword("123456");
        return Redisson.create(config);
    }
}
